-module(erlapi_sup).

-behaviour(supervisor).

-export([start_link/0]).

-export([init/1]).


start_link() ->
    supervisor:start_link({local, ?MODULE}, ?MODULE, []).


init([]) ->
    MySQLArgs = [
        {dbs, [core]}           %数据库列表
        ,{mod, db_mysql_mod}    %管理模块(主要做版本管理)
        % 数据库信息
        ,{core, {"localhost", 3306, "root", "root", "erlapi"}}
    ],
    DbMySQLMgr = {db_mysql_mgr, {db_mysql_mgr, start_link, [MySQLArgs]}, permanent, brutal_kill, worker, [db_mysql_mgr]},

    {ok, {{one_for_one, 0, 1}, [DbMySQLMgr]}}.
